package Pojo;

import java.util.Objects;

public class SnackOrder {
    private Integer soid;//订单id
    private Integer uid;//用户id
    private Integer allprice;//总价格
    private Integer snackid;//零食id
    private Integer num;//购买数量
    private String sotime;//订单时间

    private User user;

    private Snack snack;

    @Override
    public String toString() {
        return "SnackOrder{" +
                "soid=" + soid +
                ", uid=" + uid +
                ", allprice=" + allprice +
                ", snackid=" + snackid +
                ", num=" + num +
                ", sotime='" + sotime + '\'' +
                ", user=" + user +
                ", snack=" + snack +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SnackOrder that = (SnackOrder) o;
        return Objects.equals(soid, that.soid) &&
                Objects.equals(uid, that.uid) &&
                Objects.equals(allprice, that.allprice) &&
                Objects.equals(snackid, that.snackid) &&
                Objects.equals(num, that.num) &&
                Objects.equals(sotime, that.sotime) &&
                Objects.equals(user, that.user) &&
                Objects.equals(snack, that.snack);
    }

    @Override
    public int hashCode() {
        return Objects.hash(soid, uid, allprice, snackid, num, sotime, user, snack);
    }

    public Integer getSoid() {
        return soid;
    }

    public void setSoid(Integer soid) {
        this.soid = soid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public Integer getAllprice() {
        return allprice;
    }

    public void setAllprice(Integer allprice) {
        this.allprice = allprice;
    }

    public Integer getSnackid() {
        return snackid;
    }

    public void setSnackid(Integer snackid) {
        this.snackid = snackid;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getSotime() {
        return sotime;
    }

    public void setSotime(String sotime) {
        this.sotime = sotime;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Snack getSnack() {
        return snack;
    }

    public void setSnack(Snack snack) {
        this.snack = snack;
    }

    public SnackOrder() {
    }

    public SnackOrder(Integer soid, Integer uid, Integer allprice, Integer snackid, Integer num, String sotime, User user, Snack snack) {
        this.soid = soid;
        this.uid = uid;
        this.allprice = allprice;
        this.snackid = snackid;
        this.num = num;
        this.sotime = sotime;
        this.user = user;
        this.snack = snack;
    }
}
